package com.lxq.rental.common.dto;
/**
 * @description:
 * @author: LuoXiaoQiang
 * @date: 5/10/2025 1:48 AM
 * Copyright (c) 2025, LXQ Cloud All Rights Reserved.
 */


import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class ResponseDTO<T> {
    private int code;
    private String message;
    private T data;

    public static <T> ResponseDTO<T> success(T data) {
        return new ResponseDTO<>(200, "Success", data);
    }

    public static <T> ResponseDTO<T> error(int code, String message) {
        return new ResponseDTO<>(code, message, null);
    }
}